const { ccclass, property, executeInEditMode, requireComponent, menu } = cc._decorator;

/** ListView 的Item 抽象类 */
export abstract class ListItem<T> extends cc.Component {
  data: T;

  abstract initItem(data: T, index: number);
  abstract onItemclick(data: T);

  _initItem(data: T, index?: number) {
    this.data = data;
    this.initItem(data, index);
  }

  onDestroy() {
    this.node.off(cc.Node.EventType.TOUCH_END);
  }
}
